#ifndef DOWNLOADBUTTON_H
#define DOWNLOADBUTTON_H

#include <QUrl>
#include <QObject>
#include <QWidget>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QPushButton>
#include <QFile>
#include <QFileDialog>

class DownLoadButton : public QPushButton
{
    Q_OBJECT
public:
    explicit DownLoadButton(const QString& url,const QString& name,QPushButton *parent = nullptr);

public slots:
    void handerDownLoad();//点击按钮跳转,构建请求并发起请求
    void downLoad();//响应到达处理函数

signals:

private:
    QString base_url;
    QNetworkAccessManager* manager;
    QNetworkReply *response;//响应
    QString filename;//文件名字
};

#endif // DOWNLOADBUTTON_H
